<link rel="stylesheet" type="text/css" href="../addons/jy_bargain/css/style.css">
<link rel="stylesheet" type="text/css" href="../addons/jy_bargain/css/bargain.css">
<style>
    #alert-mask2{position: fixed;background: rgba(0, 0, 0, 0.8) none repeat scroll 0 0;width: 100%;height: 100%;left: 0;top: 0;z-index: 1000;-moz-transition-duration: 400ms;-webkit-transition-duration: 400ms;transition-duration: 400ms;}
    #alert-mask3{position: fixed;background: rgba(0, 0, 0, 0.9) none repeat scroll 0 0;width: 100%;height: 100%;left: 0;top: 0;z-index: 1000;-moz-transition-duration: 400ms;-webkit-transition-duration: 400ms;transition-duration: 400ms;}
</style>
<div class='fui-page-group'>
    <div class='fui-page creditshop-detail-page'>     
        <div class='fui-content'>
            <div class="bargain-header fui-list">
                <div class="fui-list-media">
                    <img src="{{tomedia(pagedata.member.avatar)}}" alt="">
                </div>
                <div class="fui-list-inner">
                    <h2>{{pagedata.member.nickname}}</h2>
                    <p>开砍时间：{{pagedata.res.created_time}}</p>
					<p>剩余时间：{{pagedata.res.time}}</p>
                </div>
                <div><a href="javascript:;" ng-click="access_json('jy_bargain/index/')" data-nocache="true">
                    <span class="icon jinyunicon icon-shouye" style="float: right;width: 66px;color: red"> 首页</span></a>
                </div>
            </div>
            <div class="bargain-shop">
                <a href="javascript:;" ng-click="access_json('jy_bargain/detail/main/id='+pagedata.res.goods_id)" data-nocache="true" class="external">
                    <div class="bargain-shop-top fui-list">
                        <div class="fui-list-media">
                            <img src="{{tomedia(pagedata.res2.image)}}" alt="">
                        </div>
                        <div class="fui-list-inner">
                            <h2>{{pagedata.res2.title}}</h2>
                            <p>活动参与人数:{{pagedata.res2.initiate}} | 剩余参与人数:{{pagedata.res2.sy}}</p>
                            <p id="divdown1"></p>
                        </div>
                    </div>
                </a>
                <div class="bargain-shop-price fui-list">
                    <div class="bargain-shop-price-item fui-list-inner active">
                        <i style="background: #fafafa">当前成交价</i>
                        <p>
                            <span class="price"><i>&yen;</i>{{pagedata.res.now_price}}</span>
                            <span>原价 <del>&yen;{{pagedata.res.start_price}}</del></span>
                        </p>
                    </div>
                    <div class="bargain-shop-price-item fui-list-inner">
                        <i style="background: #fafafa">已砍金额</i>
                        <p>
                            <span class="price"><i>&yen;</i>{{pagedata.res.bargain_price}}</span>
                            <span>砍价次数 {{pagedata.res.bargain_times}}次</span>
                        </p>
                    </div>
                </div>
            </div>
           
            <div ng-if="pagedata.self==1" class="bargain-shop-shop">
                <span ng-if="pagedata.swi==0"><a ng-click="access_json('jy_weishop/order.create//num=1&goodsid='+pagedata.res.goodsid+'&jy_bargainid='+pagedata.res.id)" class="left" data-nocache="">立即购买</a></span>
                <span ng-if="pagedata.swi==1"><a href="#" class="left " style="background-color:#ccc;" data-nocache="true">已经下单</a></span>
                <span ng-if="pagedata.swi==2"><a href="#" class="left " style="background-color:#ccc;" data-nocache="true">已经结束</a></span>
                <span ng-if="pagedata.swi==3"><a href="#" class="left " style="background-color:#ccc;" data-nocache="true">库存不足</a></span>
                <span ng-if="pagedata.swi==4"><a href="#" class="left " style="background-color:#ccc;" data-nocache="true">没到底价</a></span>
                <span ng-if="pagedata.swi==1"><a ng-click="access_json('jy_weishop/order.detail//ordersn='+pagedata.res.order)" class="right " data-nocache="true"><i class="icon icon-cart"></i> 查看订单</a></span>
                <span  ng-if="pagedata.swi!=1 && pagedata.swi!=2 && pagedata.swi!=3 && pagedata.myself==1 && pagedata.mycanyu!=1"><a ng-click="pagedata.bargain()" class="right" id="fuceng"><i class="fu"></i>砍一刀</a></span>
                <span ng-if="pagedata.swi!=1 && pagedata.swi!=3 && pagedata.swi!=2" ><a href="javascript:void(0)" onclick="$('#share').show()" class="right"><i class="fu"></i>找人帮砍</a></span>
            </div>
            <div ng-if="pagedata.self==2"  class="bargain-shop-shop">
				<span ng-if="pagedata.swi==1"><a href="#" class="left " style="background-color:#ccc;" data-nocache="true">已经下单</a></span>
                <span ng-if="pagedata.swi==2"><a href="#" class="left " style="background-color:#ccc;" data-nocache="true">已经结束</a></span>
				<span ng-if="pagedata.swi==3"><a href="#" class="left " style="background-color:#ccc;" data-nocache="true">库存不足</a></span>
                <span ng-if="pagedata.swi!=3"><a ng-click="access_json('jy_bargain/bargain//goods_id'+pagedata.res.goods_id)" class="left external">我也要砍</a></span>
                <span ng-if="pagedata.swi!=3 && pagedata.swi!=2 && pagedata.swi!=1" ng-click="pagedata.bargain()" id="fuceng"><a class="right "><i class="fu"></i>帮砍一刀</a></span>
            </div>
            

            <div class="bargain-list">
                <div class="bargain-list-top" id="bargainTab">
                    <a href="javascript:void(0);" ng-click="pagedata.bargainTabContent=0" data="family" ng-class="{'active':pagedata.bargainTabContent!=1}">亲友团</a> 
                    <a href="javascript:void(0);" ng-click="pagedata.bargainTabContent=1" class="sta" ng-class="{'active':pagedata.bargainTabContent==1}">活动规则</a>
                </div>
                <div class="bargain-list-content" >
                    <div class="bargain-item" ng-if="pagedata.bargainTabContent!=1">
                        <ul class="bargain-list-content-ul">         
                           <div ng-if="pagedata.list">
                            <li ng-repeat=" value in pagedata.list" class="fui-list">
                                <div class="fui-list-media first"><img ng-src="{{value.avatar }}" alt=""></div>
                                <div class="fui-list-inner">{{value.nickname}}</div>
                                <div class="fui-list-media three">{{value.bargain_price}}元</div>
                                <div class="fui-list-media four">{{value.bargain_time}}</div>
                            </li>
                            </div>
                            <li ng-if="pagedata.list==''" style="padding-top: 10px;text-align: center">
                                还没有人帮忙砍价
                            </li>
                           
                        </ul>
                    </div>
                    <div ng-if="pagedata.content" class="bargain-item">
                        <div class="detail-info content content-images">
						  <div class="fui-article-content" ng-bind-html="trust(pagedata.content)"></div>
						</div>
					</div>
                    <div class="bargain-item" ng-if="pagedata.bargainTabContent==1" style="margin:0 1rem;margin-top: 20px">
						 <div class="fui-article-content" ng-bind-html="trust(pagedata.rule)"></div>
                    </div>
                </div>
            </div>
            <br>
           
        </div>

    </div>

</div>
<script type="text/javascript">
scope.pagedata.bargain=function () {
		var params = {
					'plugin':'jy_bargain',
					'action':'bargain',
					'op':'bargain',
					'data':{
						'actor_id':scope.pagedata.res.id,
					},
					'callback':function(data){
							if(data.money!=null){
								window.scope.pagedata.money=data.money;
								window.scope.pagedata.url=data.url;
								scope.pagedata.showbargain=1
								scope.$evalAsync();	
								 var res = document.getElementById('bargainres');
								res.style.display = 'block';
						}								
					}
		}
		scope.post_json(params);
}
scope.pagedata.tiao=function () {
		window.location.reload();
}
</script>
<div ng-if="pagedata.showbargain==1">
    <div class="lynn-bargain-bg" style="position:absolute;z-index:10000;height: 100%">
        <p>恭喜您</p>
        <span style="margin-bottom:2rem">砍掉{{pagedata.money}}元</span>
        <a class="lynn-bargain-bg-a" style="width: 130px;height: 35px;" ng-click="pagedata.tiao()"><span style="margin-top: 6px;font-size: 1.5em;color: #FFFFFF">知道了</span></a>
    </div>
    <div style="position:absolute;z-index:1;"></div>
</div>
<!-- 关注公众号 -->
<div id="attention" ng-if="pagedata.showqrcode==1">
    <div class="attention-alert">
        <div class="attention-img"><img ng-src="{{tomedia(pagedata.pluginset.logo) || '../core/resource/images/nopic.jpg'}}" alt=""></div>
        <div class="attention-title">请您先关注我们的公众号,获取砍价助力信息！</div>
        <div class="attention-content">
            <div class="col-jy-2" style="text-align: center;"><img ng-src="{{tomedia(pagedata.pluginset.followqrcode) || '../core/resource/images/nopic.jpg'}}" alt=""style="width: 5.35rem"></div>
            <div class="col-jy-2" style="text-align: center;"><img src="../addons/jy_weishop/images/zhiwen.png" style="width: 3.3rem;margin:auto"></div>
            <p >长按指纹识别图中二维码</p>
        </div>
        <i class="icon icon-cuowu" ng-click="pagedata.showqrcode=0" style="font-size:1.5rem;color:#fff;position: absolute;top:105%;left:46%"></i>
    </div>
</div>
<div style="display: none" id="share">   
    <div id="alert-mask3" style="position:absolute;z-index:1;" onclick="$('#share').hide()">
        <img src="../addons/jy_weishop/resource/images/peerpayshare.png" alt="" width="100%" >
        <div style='font-family: "Microsoft YaHei UI", "微软雅黑", "宋体";color: #fff;text-align: center;'>转发给好友帮你砍价</div> 
    </div>
</div> 